package cn.cas.mango.controller;

import cn.cas.mango.dto.Message;
import cn.cas.mango.dto.param.MaterialParam;
import cn.cas.mango.service.MaterialSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;

/**
 * 关于material搜索的接口
 */
@Controller
@RequestMapping("/MaterialManager/")
@ResponseBody
@CrossOrigin
public class MaterialDetail {
  @Autowired
  private MaterialSearchService materialSearchService;
  @RequestMapping(value = "material/getReferInfo",method = {RequestMethod.GET})
  public Message getReferInfo(MaterialParam materialParam) throws IOException {
    return materialSearchService.getReferInfo(materialParam);
  }

  @RequestMapping(value = "material/getReferInfo",method = {RequestMethod.POST})
  public Message getReferInfoPost( MaterialParam materialParam) throws IOException {
    return materialSearchService.getReferInfo(materialParam);
  }

  @RequestMapping(value = "material/getKeywords",method = {RequestMethod.GET})
  public Message getKeywords(MaterialParam materialParam) throws IOException {
    return materialSearchService.getKeywords(materialParam);
  }

  @RequestMapping(value = "material/getKeywords",method = {RequestMethod.POST})
  public Message getKeywordsPost( MaterialParam materialParam) throws IOException {
    return materialSearchService.getKeywords(materialParam);
  }

  @RequestMapping(value = "search/queryAnalysis",method = {RequestMethod.GET})
  public Message queryAnalysis( MaterialParam materialParam) throws IOException {
    return materialSearchService.queryAnalysis(materialParam);
  }
  @RequestMapping(value = "search/queryAnalysis",method = {RequestMethod.POST})
  public Message queryAnalysisPost( MaterialParam materialParam) throws IOException {
    return materialSearchService.queryAnalysis(materialParam);
  }
  @RequestMapping(value = "material/clickReferAxis",method = {RequestMethod.GET})
  public Message clickReferAxis( MaterialParam materialParam) throws IOException {
    return materialSearchService.clickReferAxis(materialParam);
  }
  @RequestMapping(value = "material/clickReferAxis",method = {RequestMethod.POST})
  public Message clickReferAxisPost( MaterialParam materialParam) throws IOException {
    return materialSearchService.clickReferAxis(materialParam);
  }




}
